package com.anzia.pagejump.slice;

import com.anzia.pagejump.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class SecondAbilitySlice extends AbilitySlice {

	@Override
	public void onStart(Intent intent) {
		super.onStart(intent);
		super.setUIContent(ResourceTable.Layout_ability_2);

		Text text = (Text) findComponentById(ResourceTable.Id_ability_text_2);	// 获得text组件
		// getStringParam()，从inent中通过键获取值，因为是键值对形式；返回的结果为"鸿蒙，你好"
		text.setText(intent.getStringParam("data"));	// 修改text组件的内容，会覆盖原来的内容

	}

	@Override
	public void onActive() {
		super.onActive();
	}

	@Override
	public void onForeground(Intent intent) {
		super.onForeground(intent);
	}
}
